import * as echarts from 'echarts';
import { randomNumArr } from '@/constants/util/random-utils';
type EChartsOption = echarts.EChartsOption;

export const useStudentTotalCharts = () => {
  const title = '招生数量图';
  const option: EChartsOption = {
    title: {
      text: title
    },
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data: ['Breaking', 'Jazz', 'Urban', 'Popping', '民族', '拉丁']
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: [
        '1月',
        '2月',
        '3月',
        '、4月',
        '5月',
        '6月',
        '7月',
        '8月',
        '9月',
        '10月',
        '11月',
        '12月'
      ]
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: 'Breaking',
        type: 'line',
        data: randomNumArr(12, 50)
      },
      {
        name: 'Jazz',
        type: 'line',
        data: randomNumArr(12, 50)
      },
      {
        name: 'Urban',
        type: 'line',
        data: randomNumArr(12, 50)
      },
      {
        name: 'Popping',
        type: 'line',
        data: randomNumArr(12, 20)
      },
      {
        name: '民族',
        type: 'line',
        data: randomNumArr(12, 50)
      },
      {
        name: '拉丁',
        type: 'line',
        data: randomNumArr(12, 50)
      }
    ]
  };
  return { option };
};
